package com.item.service;

import com.item.dao.QuestionRecommendMapper;
import com.item.dao.model.QuestionRecommend;
import com.item.dao.model.QuestionRecommendExample;
import com.item.mobile.MAppQuestion;
import com.mobile.api.proto.MAppQuestion.MQuestions;

import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionRecommendService {
    @Autowired
    private QuestionRecommendMapper questionRecommendMapper;

    private static final Logger logger = Logger.getLogger(QuestionRecommendService.class);

    public int countByExample(QuestionRecommendExample example) {
        return this.questionRecommendMapper.countByExample(example);
    }

    public QuestionRecommend selectByPrimaryKey(String id) {
        return this.questionRecommendMapper.selectByPrimaryKey(id);
    }

    public List<QuestionRecommend> selectByExample(QuestionRecommendExample example) {
        return this.questionRecommendMapper.selectByExample(example);
    }

    public int deleteByPrimaryKey(String id) {
        return this.questionRecommendMapper.deleteByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(QuestionRecommend record) {
        return this.questionRecommendMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(QuestionRecommend record) {
        return this.questionRecommendMapper.updateByPrimaryKey(record);
    }

    public int deleteByExample(QuestionRecommendExample example) {
        return this.questionRecommendMapper.deleteByExample(example);
    }

    public int updateByExampleSelective(QuestionRecommend record, QuestionRecommendExample example) {
        return this.questionRecommendMapper.updateByExampleSelective(record, example);
    }

    public int updateByExample(QuestionRecommend record, QuestionRecommendExample example) {
        return this.questionRecommendMapper.updateByExample(record, example);
    }

    public int insert(QuestionRecommend record) {
        return this.questionRecommendMapper.insert(record);
    }

    public int insertSelective(QuestionRecommend record) {
        return this.questionRecommendMapper.insertSelective(record);
    }
    
    public void addQuestionByExample(MQuestions.Builder ret,
    		QuestionRecommendExample example) {
    	List<QuestionRecommend> list =
    			this.questionRecommendMapper.selectByExample(example);
    	if(list.size() > 0) {
//    		ret.addList(MAppQuestion.assembleData(list.get(0)));
    	}
    }
}